package defpackage; import android.content.Context; import cn.wps.shareplay.message.Message; import com.appsflyer.share.Constants; import java.util.Iterator; import org.apache.http.HttpHost; import org.json.JSONException; import org.json.JSONObject; /* renamed from: zvi reason: default package */ public class zvi { private static int A = 4096; private static boolean B = false; static zvu BLA = new zvu(2); static zvu BLB = new zvu(1); private static zvl BLC = zvl.APP_LAUNCH; private static long BLD = 0; private static long BLE = 300000; public static boolean BLF = true; private static String BLG = "http://pingma.qq.com:80/mstat/report"; private static zvx BLz = zwh.gTk(); private static String C = null; static String c = "__HIBERNATE__"; static String d = ""; private static boolean g = true; private static int h = 30000; private static int i = 1024; private static int j = 30; private static int k = 3; private static int l = 30; private static String m = null; private static String n; private static String o; private static int p = 1440; private static int q = 1024; private static boolean r = true; private static int v = 0; private static volatile int w = 0; private static int x = 20; private static int y = 0; private static boolean z = false; public static void Lk(boolean z2) { g = false; BLz.warn("!!!!!!MTA StatService has been disabled!!!!!!"); } static int a() { return j; } static String a(String str, String str2) { try { String string = BLB.b.getString(str); if (string != null) { return string; } return null; } catch (Throwable th) { BLz.cN(th); } } static synchronized void a(int i2) { synchronized (zvi.class) { w = 0; } } static void a(JSONObject jSONObject) { try { Iterator<String> keys = jSONObject.keys(); while (keys.hasNext()) { String next = keys.next(); if (next.equalsIgnoreCase(Integer.toString(BLB.a))) { a(BLB, jSONObject.getJSONObject(next)); } else if (next.equalsIgnoreCase(Integer.toString(BLA.a))) { a(BLA, jSONObject.getJSONObject(next)); } else if (next.equalsIgnoreCase("rs")) { zvl axc = zvl.axc(jSONObject.getInt(next)); if (axc != null) { BLC = axc; BLz.cP("Change to ReportStrategy:" + axc.name()); } } else { return; } } } catch (JSONException e) { BLz.g(e); } } static void a(zvu zvu) { if (zvu.a == BLB.a) { BLB = zvu; aB(zvu.b); } else if (zvu.a == BLA.a) { BLA = zvu; } } /* JADX WARNING: Code restructure failed: missing block: B:16:0x0043, code lost: r0 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:17:0x0044, code lost: defpackage.zvi.BLz.g(r0); */ /* JADX WARNING: Code restructure failed: missing block: B:21:0x005b, code lost: r0 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:22:0x005c, code lost: defpackage.zvi.BLz.cO(r0); */ /* JADX WARNING: Code restructure failed: missing block: B:45:?, code lost: return; */ /* JADX WARNING: Code restructure failed: missing block: B:46:?, code lost: return; */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Removed duplicated region for block: B:21:0x005b A[ExcHandler: Throwable (r0v0 'th' java.lang.Throwable A[CUSTOM_DECLARE]), Splitter:B:1:0x0002] */ private static void a(zvu zvu, JSONObject jSONObject) { boolean z2 = false; try { Iterator<String> keys = jSONObject.keys(); while (keys.hasNext()) { String next = keys.next(); if (next.equalsIgnoreCase("v")) { int i2 = jSONObject.getInt(next); boolean z3 = zvu.d != i2 ? true : z2; zvu.d = i2; z2 = z3; } else if (next.equalsIgnoreCase(Constants.URL_CAMPAIGN)) { String string = jSONObject.getString(Constants.URL_CAMPAIGN); if (string.length() > 0) { zvu.b = new JSONObject(string); } } else if (next.equalsIgnoreCase("m")) { zvu.c = jSONObject.getString("m"); } } if (z2) { zwx lG = zwx.lG(zwn.a()); if (!(lG == null || zvu == null)) { lG.a.post(new zxc(lG, zvu)); } if (zvu.a == BLB.a) { aB(zvu.b); String string2 = zvu.b.getString(c); BLz.cP("hibernateVer:" + string2 + ", current version:1.6.2"); long agC = zwh.agC(string2); if (zwh.agC("1.6.2") <= agC) { zwm.f(zwn.a(), c, agC); Lk(false); BLz.warn("MTA has disable for SDK version of " + string2 + " or lower."); } } } } catch (JSONException e) { BLz.cP("__HIBERNATE__ not found."); } catch (Throwable th) { } } private static void aB(JSONObject jSONObject) { try { zvl axc = zvl.axc(jSONObject.getInt("rs")); if (axc != null) { BLC = axc; BLz.cP("Change to statSendStrategy: " + axc); } } catch (JSONException e) { BLz.cP("rs not found."); } } static void b(int i2) { y = 0; } static synchronized void c() { synchronized (zvi.class) { w++; } } static void d() { y++; } static int e() { return y; } public static zvl gST() { return BLC; } public static boolean gSU() { return g; } public static int gSV() { return h; } public static int gSW() { return l; } public static int gSX() { return k; } public static int gSY() { return i; } static HttpHost gSZ() { if (m == null || m.length() <= 0) { return null; } String str = m; String[] split = str.split(Message.SEPARATE2); int i2 = 80; if (split.length == 2) { str = split[0]; i2 = Integer.parseInt(split[1]); } return new HttpHost(str, i2); } public static int gTa() { return p; } public static int gTb() { return q; } public static boolean gTc() { return r; } public static boolean gTd() { return BLF; } public static String gTe() { return BLG; } public static int gTf() { return v; } public static int gTg() { return w; } public static int gTh() { return x; } public static int gTi() { return A; } public static boolean gTj() { return B; } public static synchronized String lf(Context context) { String str; synchronized (zvi.class) { if (n != null) { str = n; } else { if (context != null && n == null) { n = zwh.i(context); } if (n == null || n.trim().length() == 0) { BLz.error("AppKey can not be null or empty, please read Developer's Guide first!"); } str = n; } } return str; } public static synchronized String lg(Context context) { String str; synchronized (zvi.class) { if (o != null) { str = o; } else { String j2 = zwh.j(context); o = j2; if (j2 == null || o.trim().length() == 0) { BLz.cN("installChannel can not be null or empty, please read Developer's Guide first!"); } str = o; } } return str; } public static String lh(Context context) { if (context == null) { BLz.error("Context for getCustomUid is null."); return null; } if (C == null) { C = zwm.a(context, "MTA_CUSTOM_UID", ""); } return C; } public static String li(Context context) { return zvj.li(context); } public static zvg lj(Context context) { return zvj.lj(context); } }